package com.example;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

public class TaofuGreenDao {

    private static final int DB_SERSION = 1;


    public static void main(String[] args) throws Exception {

        //获取Schema对象
        Schema schema = new Schema(DB_SERSION, "org.taofuxn.assistant.database.model");
        schema.setDefaultJavaPackageDao("org.taofuxn.assistant.database.dao");
        //创建收藏夹列表
        createCollection(schema);

        //输出的目录要自己创建
        new DaoGenerator().generateAll(schema, "../assistant/app/src/main/java/");
    }

    private static void createCollection(Schema schema) {
        Entity clock = schema.addEntity("Collection");
        clock.addIdProperty().autoincrement().primaryKey();
        clock.addStringProperty("content");
        clock.addStringProperty("hashId");
        clock.addStringProperty("unixtime");
        clock.addStringProperty("updatetime");
        clock.addStringProperty("url");
    }

}